﻿//保存学员分团
var responseSuccess = function (res) {
    try {
        var str = res.responseText;
        if (str == "1") {
            //return true;
            alert("修改学员信息成功!");
            parent.ReLoadData();
        }
        else {
            alert(str);
        }
    } catch (e) {
    }
    finally {
    }
};
var responseFailure = function (error) {
    alert("数据错误：" + error.statusText);
}
var callback = {
    success: responseSuccess,
    failure: responseFailure
};
var fnCustomSave = function () {
    setValue();
    var json = $.toJSON(instance[0]).replace(/'/g, "[B]");
    //var json =$.toJSON(instance[0]).replace(/'/g,"[B]").replace(/\n/g,'[BR]');
    $("#jsonDataContent").val(json);
    var json = "", url = "http://" + this.location.host + "/Extend/AjaxData/DataProcessin.aspx";
    for (var i = 0; i < parent.ids.length; i++) {
        //instance[0].ID = parent.ids[i];
        var formObject = document.getElementById('form2');
        YAHOO.util.Connect.setForm(formObject);
        var cObj = YAHOO.util.Connect.asyncRequest('POST', url + "?flag=1&action=Update&entity=CrmMajorStudent&id=" + parent.ids[i] + "&json=" + encodeURI($("#jsonDataContent").val().replace(/&/g, "[A]").replace(/'/g, "[B]")), callback);
        //json =$.toJSON(instance[0]).replace(/'/g,"[B]");
        //$("#EditForm").SaveData(url,"CrmMajorStudent",json,"update");
    }
}
